#根据给定的年月日以数字形式打印日期
months=[
    'January',
    'February',
    'March',
    'April',
    'May',
    'June',
    'July',
    'August',
    'September',
    'October',
    'November',
    'December'
]
#以1-31数字作为结尾的列表
endings=['st','nd','rd'] + 17*['th']\
        +['st','nd','rd'] + 7*['th']\
        +['st']
year = input('Year:')
month = input('Month(1-12):')
day = input('Day(1-31):')

monthNumber = int(month)
dayNumber = int(day)
#获取正确的索引
monthName = months[monthNumber-1]
dayName = day + endings[dayNumber-1]
#打印输出结果
print (monthName + ' ' + dayName +'.'+year)